POV-Ray : Newsgroups : povray.general : QNAN - Error... : Re: QNAN - Error... Server Time
1 Aug 2024 04:10:58 EDT (-0400)
  Re: QNAN - Error...  
From: Tim Nikias
Date: 25 Mar 2006 07:07:49
Message: <44253295$1@news.povray.org>
> The IEEE standard defines two classes of NaN: quiet NaNs (QNaNs) and
> signaling NaNs (SNaNs). A QNaN is a NaN with the most significant
> fraction bit set; an SNaN is a NaN with the most significant fraction
> bit clear. QNaNs are allowed to propagate through most arithmetic
> operations without signaling an exception. SNaNs generally signal an
> invalid-operation excep-tion whenever they appear as operands in
> arithmetic operations.
>
> I was just thinking that Division by zero in float should not give a
> NAN strictly speaking because you can never really express a ZERO in
> float, instead it will be a small residual value.

Hm, all that's pretty interesting and such, but is there any way that I can
check for that in order to prevent POV-Ray writing 1.#QNAN instead of some
number? Should I perhaps check if something is below a certain threshold
value, but not 0, and then do something appropriate to/for the data (e.g. if
it's a vector from a matrix, add+normalize+regenerate a little). Basically,
I take it that this is some sort of precision problem, the kind you can get
when working with too small or too large numbers. Is that a correct
assumption? I might have to write myself a script to generate QNANs in order
to "experiment" what I can do about them... Unless someone already knows a
fool-proof way of generating one?

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.